package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     *  获取有某个菜品的套餐集合
     * @param id 菜品id
     * @return
     */
    List<Long> getSetmealIdsByDishId(Long id);

    /**
     *  批量插入套餐菜品信息
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     *  根据套餐id删除菜品信息
     * @param id
     */
    @Delete("")
    void deleteBySetmealId(Long id);

    /**
     *   根据套餐id获取套餐信息
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where id=#{id}")
    List<SetmealDish> getByDishId(Long id);
}
